#include <windows.h>
HWND myCreateStatic(HWND hwnd, int id, char* s, int x, int y, int width, int height)
{ HWND h;
h = CreateWindowEx(WS_EX_STATICEDGE, "STATIC",
s,
WS_CHILD | WS_VISIBLE | SS_LEFT | SS_NOPREFIX,
x,y,width,height,
hwnd,
(HMENU) id,
GetModuleHandle(NULL), NULL);
if (h) { HFONT hfDefault;
hfDefault = (HFONT) GetStockObject(DEFAULT_GUI_FONT);
SendMessage(h, WM_SETFONT, (WPARAM)hfDefault, MAKELPARAM(FALSE, 0));
}
else
MessageBox(hwnd, "MyCreateStatic could not create static text.",
"Error", MB_OK | MB_ICONERROR);
return h;
}